<!--
 * @Author: 熔岩巨兽 2141826215@qq.com
 * @Date: 2024-08-31 13:53:42
 * @LastEditTime: 2024-08-31 14:11:57
 * @LastEditors: 熔岩巨兽 2141826215@qq.com
 * @FilePath: \vue-vite-project\src\views\CommunicationMode\eventBus\event2.vue
 * Copyright (c) 2024 by 熔岩巨兽 2141826215@qq.com, All Rights Reserved. 
-->
<template>
  <div class="count_warpper2">
    <h1>我是组件2</h1>
    <button @click="eventBus">点击事件</button>
  </div>
</template>

<script lang="ts" setup name="event2">
import { ref } from "vue";
import $bus from "@/eventBus/index";
const eventBus = () => {
  console.log("点击事件");
  $bus.emit("eventBus", "组件2：我给你的信息");
};
</script>

<style scoped>
.count_warpper2 {
  width: 300px;
  height: 300px;
  background-color: aliceblue;
}
</style>
